﻿using System;
using System.Collections.Generic;
using System.Text;
using Infrastructure.Lib.Core;
using Infrastructure.Lib.Core.NPOIHelper;

namespace CrmSpider.Model
{
    public class TracerModel
    {
        [ColumnType(Name = "客户名称")]
        public string CustomerName { get; set; }

        [ColumnType(Name = "跟踪人")]
        public string Tracers { get; set; }

        public TracerModel(string customerName, string oriStr)
        {
            var tracerStr = oriStr.Substring2("x73_state[\\s\\S]+?\"Values\": ", ",\r", true);
            var tracers = tracerStr.JsonToModels<List<List<string>>>();
            var ts = new List<string>();

            foreach (var t in tracers)
            {
                ts.Add(t[2]);
            }

            CustomerName = customerName;
            Tracers = String.Join(",", ts);
        }
    }
}
